Skip to content

Finalize local message hashes and accept SHA-256 API references - #45

Merged
markmnl merged 4 commits into
mainfrom
feat/finalize-message-sha256
Sep 10, 2026
Merged

Finalize local message hashes and accept SHA-256 API references#45
markmnl merged 4 commits into
mainfrom
feat/finalize-message-sha256

Conversation

@markmnl

@markmnl markmnl commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Local-only sends and reactions acquire their protocol SHA-256 atomically with time_sent. Mutations share a transaction and row lock, stage file writes, and return success after commit. The shared finalizer retains the immutable wire representation for federation and independently finalizes add-to batches.

Expose sha256/psha256 in message, list, WebSocket and structured thread responses, preserving message_sha256 as an alias. Message routes accept numeric IDs or SHA-256. Request pid also accepts original or batch hashes while response pid stays numeric. Participation checks apply to the referenced branch; batch-only participants use the batch hash to reply.

Depends on markmnl/fmsgd#44 (module pinned to its feature commit) and implements markmnl/fmsg#37. Existing installations stop both services and run the standalone fmsg-backfill binary, which embeds the schema upgrade and converts existing data atomically. Start the matching services after migration succeeds. The runtime requires finalized storage; only drafts expose null message hashes. Docker integration: markmnl/fmsg-docker#21.

Validation: builds, Go tests, PostgreSQL integration tests, race checks and vet passed. Tests cover concurrent sends/edits, rollback and commit rejection, hash authorization, batch replies and WebSocket payloads. The coordinated Docker suite passed all 15 tests with forced challenges, including later federation of locally delivered compressed messages. CI runs the PostgreSQL tests against the schema from the pinned daemon module.

@markmnl
markmnl merged commit 1a0cff1 into main Sep 10, 2026
1 check passed
@markmnl
markmnl deleted the feat/finalize-message-sha256 branch September 10, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant